//
//  HLMeViewController.m
//  HL-百思不得姐
//
//  Created by admin on 16/4/25.
//  Copyright © 2016年 CHL. All rights reserved.
//

#import "HLMeViewController.h"
#import "HLSettingViewController.h"

@interface HLMeViewController ()

@end

@implementation HLMeViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    //设置导航栏
    [self setupNavBar];
}

#pragma mark - 设置导航栏
- (void)setupNavBar
{
    UIBarButtonItem *settingItem = [UIBarButtonItem itemWithImage:[UIImage imageNamed:@"mine-setting-icon"] hightlightImage:[UIImage imageNamed:@"mine-setting-icon-click"] target:self action:@selector(settingIconClick)];
    
    UIBarButtonItem *nightItem = [UIBarButtonItem itemWithImage:[UIImage imageNamed:@"mine-moon-icon"] selectedImage:[UIImage imageNamed:@"mine-moon-icon-click"] target:self action:@selector(moonIconClick:)];
    
    self.navigationItem.rightBarButtonItems = @[settingItem, nightItem];
    
    self.navigationItem.title = @"我的";
}

#pragma mark - 导航栏按钮点击事件
//点击设置按钮
- (void)settingIconClick
{
    HLSettingViewController *settingVC = [[HLSettingViewController alloc] init];
    //需在跳转前隐藏
//    settingVC.hidesBottomBarWhenPushed = YES;
    
    settingVC.view.backgroundColor = [UIColor purpleColor];
    [self.navigationController pushViewController:settingVC animated:YES];
}

//点击夜间模式
- (void)moonIconClick:(UIButton *)button
{
    button.selected = !button.selected;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
